<?php
namespace app\send\behavior;
use app\send\logic\msg\AliMsg;
use app\send\logic\msg\YunpianMsg;
use app\send\logic\msg\JuheMsg;
use app\send\logic\msg\SmsbaoMsg;
use app\send\logic\msg\ChuangLaiMsg;
/**
 * 短信服务商
 */
class MessageBehavior
{
	/**
	 * [调用短信服务商发送短信]
	 * @param  [type] &$param.phone [手机号]
	 * @param  [type] &$param.code [验证码]
	 * @param  [type] $type   [类型]
	 * @return [type]         [description]
	 */
	public function run(&$param,$type){
		$obj = '';
        switch ($type) {
        	case 1:
                $obj = new AliMsg();
        		break;
            case 2:
                $obj = new YunpianMsg();
                break;
            case 3:
                $obj = new JuheMsg();
                break;
            case 4:
                $obj = new SmsbaoMsg();
                break;
            case 5:
                $obj = new ChuangLaiMsg();
                break;
        	default:
        		return [
        				'code'=>1,
        				'msg'=>'测试数据',
        			];
        		break;
        }
        
        return $obj->index($param['phone'],$param['code']);	
	}
}

